﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using PAT.Entities;
using PAT.Data;

#endregion

namespace PAT.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="PatUbicacionGeograficaProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class PatUbicacionGeograficaProviderBaseCore : EntityProviderBase<PAT.Entities.PatUbicacionGeografica, PAT.Entities.PatUbicacionGeograficaKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, PAT.Entities.PatUbicacionGeograficaKey key)
		{
			return Delete(transactionManager, key.IdUbicacion);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_idUbicacion">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _idUbicacion)
		{
			return Delete(null, _idUbicacion);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idUbicacion">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _idUbicacion);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="_idTipoUbicacion"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdTipoUbicacion(System.Int16 _idTipoUbicacion)
		{
			int count = -1;
			return GetByIdTipoUbicacion(_idTipoUbicacion, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTipoUbicacion"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		/// <remarks></remarks>
		public TList<PatUbicacionGeografica> GetByIdTipoUbicacion(TransactionManager transactionManager, System.Int16 _idTipoUbicacion)
		{
			int count = -1;
			return GetByIdTipoUbicacion(transactionManager, _idTipoUbicacion, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTipoUbicacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdTipoUbicacion(TransactionManager transactionManager, System.Int16 _idTipoUbicacion, int start, int pageLength)
		{
			int count = -1;
			return GetByIdTipoUbicacion(transactionManager, _idTipoUbicacion, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA key.
		///		fkPatUbicacionGeograficaPatTipoUbicacionGeografica Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTipoUbicacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdTipoUbicacion(System.Int16 _idTipoUbicacion, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdTipoUbicacion(null, _idTipoUbicacion, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA key.
		///		fkPatUbicacionGeograficaPatTipoUbicacionGeografica Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTipoUbicacion"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdTipoUbicacion(System.Int16 _idTipoUbicacion, int start, int pageLength,out int count)
		{
			return GetByIdTipoUbicacion(null, _idTipoUbicacion, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_TIPO_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTipoUbicacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public abstract TList<PatUbicacionGeografica> GetByIdTipoUbicacion(TransactionManager transactionManager, System.Int16 _idTipoUbicacion, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="_idUbicacionPadre"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdUbicacionPadre(System.Int32? _idUbicacionPadre)
		{
			int count = -1;
			return GetByIdUbicacionPadre(_idUbicacionPadre, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idUbicacionPadre"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		/// <remarks></remarks>
		public TList<PatUbicacionGeografica> GetByIdUbicacionPadre(TransactionManager transactionManager, System.Int32? _idUbicacionPadre)
		{
			int count = -1;
			return GetByIdUbicacionPadre(transactionManager, _idUbicacionPadre, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idUbicacionPadre"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdUbicacionPadre(TransactionManager transactionManager, System.Int32? _idUbicacionPadre, int start, int pageLength)
		{
			int count = -1;
			return GetByIdUbicacionPadre(transactionManager, _idUbicacionPadre, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA key.
		///		fkPatUbicacionGeograficaPatUbicacionGeografica Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idUbicacionPadre"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdUbicacionPadre(System.Int32? _idUbicacionPadre, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdUbicacionPadre(null, _idUbicacionPadre, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA key.
		///		fkPatUbicacionGeograficaPatUbicacionGeografica Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idUbicacionPadre"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public TList<PatUbicacionGeografica> GetByIdUbicacionPadre(System.Int32? _idUbicacionPadre, int start, int pageLength,out int count)
		{
			return GetByIdUbicacionPadre(null, _idUbicacionPadre, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA key.
		///		FK_PAT_UBICACION_GEOGRAFICA_PAT_UBICACION_GEOGRAFICA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idUbicacionPadre"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatUbicacionGeografica objects.</returns>
		public abstract TList<PatUbicacionGeografica> GetByIdUbicacionPadre(TransactionManager transactionManager, System.Int32? _idUbicacionPadre, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override PAT.Entities.PatUbicacionGeografica Get(TransactionManager transactionManager, PAT.Entities.PatUbicacionGeograficaKey key, int start, int pageLength)
		{
			return GetByIdUbicacion(transactionManager, key.IdUbicacion, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_PAT_UBICACION_GEOGRAFICA index.
		/// </summary>
		/// <param name="_idUbicacion"></param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatUbicacionGeografica"/> class.</returns>
		public PAT.Entities.PatUbicacionGeografica GetByIdUbicacion(System.Int32 _idUbicacion)
		{
			int count = -1;
			return GetByIdUbicacion(null,_idUbicacion, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_UBICACION_GEOGRAFICA index.
		/// </summary>
		/// <param name="_idUbicacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatUbicacionGeografica"/> class.</returns>
		public PAT.Entities.PatUbicacionGeografica GetByIdUbicacion(System.Int32 _idUbicacion, int start, int pageLength)
		{
			int count = -1;
			return GetByIdUbicacion(null, _idUbicacion, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_UBICACION_GEOGRAFICA index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idUbicacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatUbicacionGeografica"/> class.</returns>
		public PAT.Entities.PatUbicacionGeografica GetByIdUbicacion(TransactionManager transactionManager, System.Int32 _idUbicacion)
		{
			int count = -1;
			return GetByIdUbicacion(transactionManager, _idUbicacion, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_UBICACION_GEOGRAFICA index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idUbicacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatUbicacionGeografica"/> class.</returns>
		public PAT.Entities.PatUbicacionGeografica GetByIdUbicacion(TransactionManager transactionManager, System.Int32 _idUbicacion, int start, int pageLength)
		{
			int count = -1;
			return GetByIdUbicacion(transactionManager, _idUbicacion, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_UBICACION_GEOGRAFICA index.
		/// </summary>
		/// <param name="_idUbicacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatUbicacionGeografica"/> class.</returns>
		public PAT.Entities.PatUbicacionGeografica GetByIdUbicacion(System.Int32 _idUbicacion, int start, int pageLength, out int count)
		{
			return GetByIdUbicacion(null, _idUbicacion, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_UBICACION_GEOGRAFICA index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idUbicacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatUbicacionGeografica"/> class.</returns>
		public abstract PAT.Entities.PatUbicacionGeografica GetByIdUbicacion(TransactionManager transactionManager, System.Int32 _idUbicacion, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;PatUbicacionGeografica&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;PatUbicacionGeografica&gt;"/></returns>
		public static TList<PatUbicacionGeografica> Fill(IDataReader reader, TList<PatUbicacionGeografica> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				PAT.Entities.PatUbicacionGeografica c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("PatUbicacionGeografica")
					.Append("|").Append((System.Int32)reader[((int)PatUbicacionGeograficaColumn.IdUbicacion - 1)]).ToString();
					c = EntityManager.LocateOrCreate<PatUbicacionGeografica>(
					key.ToString(), // EntityTrackingKey
					"PatUbicacionGeografica",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new PAT.Entities.PatUbicacionGeografica();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.IdUbicacion = (System.Int32)reader[((int)PatUbicacionGeograficaColumn.IdUbicacion - 1)];
					c.IdUbicacionPadre = (reader.IsDBNull(((int)PatUbicacionGeograficaColumn.IdUbicacionPadre - 1)))?null:(System.Int32?)reader[((int)PatUbicacionGeograficaColumn.IdUbicacionPadre - 1)];
					c.IdTipoUbicacion = (System.Int16)reader[((int)PatUbicacionGeograficaColumn.IdTipoUbicacion - 1)];
					c.Nombre = (System.String)reader[((int)PatUbicacionGeograficaColumn.Nombre - 1)];
					c.CodigoDivipola = (reader.IsDBNull(((int)PatUbicacionGeograficaColumn.CodigoDivipola - 1)))?null:(System.String)reader[((int)PatUbicacionGeograficaColumn.CodigoDivipola - 1)];
					c.CodigoTelefonico = (reader.IsDBNull(((int)PatUbicacionGeograficaColumn.CodigoTelefonico - 1)))?null:(System.Int16?)reader[((int)PatUbicacionGeograficaColumn.CodigoTelefonico - 1)];
					c.Activo = (System.Boolean)reader[((int)PatUbicacionGeograficaColumn.Activo - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatUbicacionGeografica"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatUbicacionGeografica"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, PAT.Entities.PatUbicacionGeografica entity)
		{
			if (!reader.Read()) return;
			
			entity.IdUbicacion = (System.Int32)reader[((int)PatUbicacionGeograficaColumn.IdUbicacion - 1)];
			entity.IdUbicacionPadre = (reader.IsDBNull(((int)PatUbicacionGeograficaColumn.IdUbicacionPadre - 1)))?null:(System.Int32?)reader[((int)PatUbicacionGeograficaColumn.IdUbicacionPadre - 1)];
			entity.IdTipoUbicacion = (System.Int16)reader[((int)PatUbicacionGeograficaColumn.IdTipoUbicacion - 1)];
			entity.Nombre = (System.String)reader[((int)PatUbicacionGeograficaColumn.Nombre - 1)];
			entity.CodigoDivipola = (reader.IsDBNull(((int)PatUbicacionGeograficaColumn.CodigoDivipola - 1)))?null:(System.String)reader[((int)PatUbicacionGeograficaColumn.CodigoDivipola - 1)];
			entity.CodigoTelefonico = (reader.IsDBNull(((int)PatUbicacionGeograficaColumn.CodigoTelefonico - 1)))?null:(System.Int16?)reader[((int)PatUbicacionGeograficaColumn.CodigoTelefonico - 1)];
			entity.Activo = (System.Boolean)reader[((int)PatUbicacionGeograficaColumn.Activo - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatUbicacionGeografica"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatUbicacionGeografica"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, PAT.Entities.PatUbicacionGeografica entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.IdUbicacion = (System.Int32)dataRow["ID_UBICACION"];
			entity.IdUbicacionPadre = Convert.IsDBNull(dataRow["ID_UBICACION_PADRE"]) ? null : (System.Int32?)dataRow["ID_UBICACION_PADRE"];
			entity.IdTipoUbicacion = (System.Int16)dataRow["ID_TIPO_UBICACION"];
			entity.Nombre = (System.String)dataRow["NOMBRE"];
			entity.CodigoDivipola = Convert.IsDBNull(dataRow["CODIGO_DIVIPOLA"]) ? null : (System.String)dataRow["CODIGO_DIVIPOLA"];
			entity.CodigoTelefonico = Convert.IsDBNull(dataRow["CODIGO_TELEFONICO"]) ? null : (System.Int16?)dataRow["CODIGO_TELEFONICO"];
			entity.Activo = (System.Boolean)dataRow["ACTIVO"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatUbicacionGeografica"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">PAT.Entities.PatUbicacionGeografica Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, PAT.Entities.PatUbicacionGeografica entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region IdTipoUbicacionSource	
			if (CanDeepLoad(entity, "PatTipoUbicacionGeografica|IdTipoUbicacionSource", deepLoadType, innerList) 
				&& entity.IdTipoUbicacionSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdTipoUbicacion;
				PatTipoUbicacionGeografica tmpEntity = EntityManager.LocateEntity<PatTipoUbicacionGeografica>(EntityLocator.ConstructKeyFromPkItems(typeof(PatTipoUbicacionGeografica), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdTipoUbicacionSource = tmpEntity;
				else
					entity.IdTipoUbicacionSource = DataRepository.PatTipoUbicacionGeograficaProvider.GetByIdTipoUbicacion(transactionManager, entity.IdTipoUbicacion);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdTipoUbicacionSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdTipoUbicacionSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatTipoUbicacionGeograficaProvider.DeepLoad(transactionManager, entity.IdTipoUbicacionSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdTipoUbicacionSource

			#region IdUbicacionPadreSource	
			if (CanDeepLoad(entity, "PatUbicacionGeografica|IdUbicacionPadreSource", deepLoadType, innerList) 
				&& entity.IdUbicacionPadreSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.IdUbicacionPadre ?? (int)0);
				PatUbicacionGeografica tmpEntity = EntityManager.LocateEntity<PatUbicacionGeografica>(EntityLocator.ConstructKeyFromPkItems(typeof(PatUbicacionGeografica), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdUbicacionPadreSource = tmpEntity;
				else
					entity.IdUbicacionPadreSource = DataRepository.PatUbicacionGeograficaProvider.GetByIdUbicacion(transactionManager, (entity.IdUbicacionPadre ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdUbicacionPadreSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdUbicacionPadreSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatUbicacionGeograficaProvider.DeepLoad(transactionManager, entity.IdUbicacionPadreSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdUbicacionPadreSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetByIdUbicacion methods when available
			
			#region PatRegimenTributarioCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatRegimenTributario>|PatRegimenTributarioCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatRegimenTributarioCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatRegimenTributarioCollection = DataRepository.PatRegimenTributarioProvider.GetByIdUbicacionPais(transactionManager, entity.IdUbicacion);

				if (deep && entity.PatRegimenTributarioCollection.Count > 0)
				{
					deepHandles.Add("PatRegimenTributarioCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatRegimenTributario>) DataRepository.PatRegimenTributarioProvider.DeepLoad,
						new object[] { transactionManager, entity.PatRegimenTributarioCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatEmpresaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatEmpresa>|PatEmpresaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatEmpresaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatEmpresaCollection = DataRepository.PatEmpresaProvider.GetByIdUbicacionPais(transactionManager, entity.IdUbicacion);

				if (deep && entity.PatEmpresaCollection.Count > 0)
				{
					deepHandles.Add("PatEmpresaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatEmpresa>) DataRepository.PatEmpresaProvider.DeepLoad,
						new object[] { transactionManager, entity.PatEmpresaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatUbicacionGeograficaCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatUbicacionGeografica>|PatUbicacionGeograficaCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatUbicacionGeograficaCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatUbicacionGeograficaCollection = DataRepository.PatUbicacionGeograficaProvider.GetByIdUbicacionPadre(transactionManager, entity.IdUbicacion);

				if (deep && entity.PatUbicacionGeograficaCollection.Count > 0)
				{
					deepHandles.Add("PatUbicacionGeograficaCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatUbicacionGeografica>) DataRepository.PatUbicacionGeograficaProvider.DeepLoad,
						new object[] { transactionManager, entity.PatUbicacionGeograficaCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatClienteCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatCliente>|PatClienteCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatClienteCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatClienteCollection = DataRepository.PatClienteProvider.GetByIdUbicacionPais(transactionManager, entity.IdUbicacion);

				if (deep && entity.PatClienteCollection.Count > 0)
				{
					deepHandles.Add("PatClienteCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatCliente>) DataRepository.PatClienteProvider.DeepLoad,
						new object[] { transactionManager, entity.PatClienteCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatUsuarioCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatUsuario>|PatUsuarioCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatUsuarioCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatUsuarioCollection = DataRepository.PatUsuarioProvider.GetByIdUbicacionCiudad(transactionManager, entity.IdUbicacion);

				if (deep && entity.PatUsuarioCollection.Count > 0)
				{
					deepHandles.Add("PatUsuarioCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatUsuario>) DataRepository.PatUsuarioProvider.DeepLoad,
						new object[] { transactionManager, entity.PatUsuarioCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatTallerCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatTaller>|PatTallerCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatTallerCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatTallerCollection = DataRepository.PatTallerProvider.GetByIdUbicacionPais(transactionManager, entity.IdUbicacion);

				if (deep && entity.PatTallerCollection.Count > 0)
				{
					deepHandles.Add("PatTallerCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatTaller>) DataRepository.PatTallerProvider.DeepLoad,
						new object[] { transactionManager, entity.PatTallerCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the PAT.Entities.PatUbicacionGeografica object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">PAT.Entities.PatUbicacionGeografica instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">PAT.Entities.PatUbicacionGeografica Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, PAT.Entities.PatUbicacionGeografica entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region IdTipoUbicacionSource
			if (CanDeepSave(entity, "PatTipoUbicacionGeografica|IdTipoUbicacionSource", deepSaveType, innerList) 
				&& entity.IdTipoUbicacionSource != null)
			{
				DataRepository.PatTipoUbicacionGeograficaProvider.Save(transactionManager, entity.IdTipoUbicacionSource);
				entity.IdTipoUbicacion = entity.IdTipoUbicacionSource.IdTipoUbicacion;
			}
			#endregion 
			
			#region IdUbicacionPadreSource
			if (CanDeepSave(entity, "PatUbicacionGeografica|IdUbicacionPadreSource", deepSaveType, innerList) 
				&& entity.IdUbicacionPadreSource != null)
			{
				DataRepository.PatUbicacionGeograficaProvider.Save(transactionManager, entity.IdUbicacionPadreSource);
				entity.IdUbicacionPadre = entity.IdUbicacionPadreSource.IdUbicacion;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
	
			#region List<PatRegimenTributario>
				if (CanDeepSave(entity.PatRegimenTributarioCollection, "List<PatRegimenTributario>|PatRegimenTributarioCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatRegimenTributario child in entity.PatRegimenTributarioCollection)
					{
						if(child.IdUbicacionPaisSource != null)
						{
							child.IdUbicacionPais = child.IdUbicacionPaisSource.IdUbicacion;
						}
						else
						{
							child.IdUbicacionPais = entity.IdUbicacion;
						}

					}

					if (entity.PatRegimenTributarioCollection.Count > 0 || entity.PatRegimenTributarioCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatRegimenTributarioProvider.Save(transactionManager, entity.PatRegimenTributarioCollection);
						
						deepHandles.Add("PatRegimenTributarioCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatRegimenTributario >) DataRepository.PatRegimenTributarioProvider.DeepSave,
							new object[] { transactionManager, entity.PatRegimenTributarioCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatEmpresa>
				if (CanDeepSave(entity.PatEmpresaCollection, "List<PatEmpresa>|PatEmpresaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatEmpresa child in entity.PatEmpresaCollection)
					{
						if(child.IdUbicacionPaisSource != null)
						{
							child.IdUbicacionPais = child.IdUbicacionPaisSource.IdUbicacion;
						}
						else
						{
							child.IdUbicacionPais = entity.IdUbicacion;
						}

					}

					if (entity.PatEmpresaCollection.Count > 0 || entity.PatEmpresaCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatEmpresaProvider.Save(transactionManager, entity.PatEmpresaCollection);
						
						deepHandles.Add("PatEmpresaCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatEmpresa >) DataRepository.PatEmpresaProvider.DeepSave,
							new object[] { transactionManager, entity.PatEmpresaCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatUbicacionGeografica>
				if (CanDeepSave(entity.PatUbicacionGeograficaCollection, "List<PatUbicacionGeografica>|PatUbicacionGeograficaCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatUbicacionGeografica child in entity.PatUbicacionGeograficaCollection)
					{
						if(child.IdUbicacionPadreSource != null)
						{
							child.IdUbicacionPadre = child.IdUbicacionPadreSource.IdUbicacion;
						}
						else
						{
							child.IdUbicacionPadre = entity.IdUbicacion;
						}

					}

					if (entity.PatUbicacionGeograficaCollection.Count > 0 || entity.PatUbicacionGeograficaCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatUbicacionGeograficaProvider.Save(transactionManager, entity.PatUbicacionGeograficaCollection);
						
						deepHandles.Add("PatUbicacionGeograficaCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatUbicacionGeografica >) DataRepository.PatUbicacionGeograficaProvider.DeepSave,
							new object[] { transactionManager, entity.PatUbicacionGeograficaCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatCliente>
				if (CanDeepSave(entity.PatClienteCollection, "List<PatCliente>|PatClienteCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatCliente child in entity.PatClienteCollection)
					{
						if(child.IdUbicacionPaisSource != null)
						{
							child.IdUbicacionPais = child.IdUbicacionPaisSource.IdUbicacion;
						}
						else
						{
							child.IdUbicacionPais = entity.IdUbicacion;
						}

					}

					if (entity.PatClienteCollection.Count > 0 || entity.PatClienteCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatClienteProvider.Save(transactionManager, entity.PatClienteCollection);
						
						deepHandles.Add("PatClienteCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatCliente >) DataRepository.PatClienteProvider.DeepSave,
							new object[] { transactionManager, entity.PatClienteCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatUsuario>
				if (CanDeepSave(entity.PatUsuarioCollection, "List<PatUsuario>|PatUsuarioCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatUsuario child in entity.PatUsuarioCollection)
					{
						if(child.IdUbicacionCiudadSource != null)
						{
							child.IdUbicacionCiudad = child.IdUbicacionCiudadSource.IdUbicacion;
						}
						else
						{
							child.IdUbicacionCiudad = entity.IdUbicacion;
						}

					}

					if (entity.PatUsuarioCollection.Count > 0 || entity.PatUsuarioCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatUsuarioProvider.Save(transactionManager, entity.PatUsuarioCollection);
						
						deepHandles.Add("PatUsuarioCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatUsuario >) DataRepository.PatUsuarioProvider.DeepSave,
							new object[] { transactionManager, entity.PatUsuarioCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatTaller>
				if (CanDeepSave(entity.PatTallerCollection, "List<PatTaller>|PatTallerCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatTaller child in entity.PatTallerCollection)
					{
						if(child.IdUbicacionPaisSource != null)
						{
							child.IdUbicacionPais = child.IdUbicacionPaisSource.IdUbicacion;
						}
						else
						{
							child.IdUbicacionPais = entity.IdUbicacion;
						}

					}

					if (entity.PatTallerCollection.Count > 0 || entity.PatTallerCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatTallerProvider.Save(transactionManager, entity.PatTallerCollection);
						
						deepHandles.Add("PatTallerCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatTaller >) DataRepository.PatTallerProvider.DeepSave,
							new object[] { transactionManager, entity.PatTallerCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region PatUbicacionGeograficaChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>PAT.Entities.PatUbicacionGeografica</c>
	///</summary>
	public enum PatUbicacionGeograficaChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>PatTipoUbicacionGeografica</c> at IdTipoUbicacionSource
		///</summary>
		[ChildEntityType(typeof(PatTipoUbicacionGeografica))]
		PatTipoUbicacionGeografica,
			
		///<summary>
		/// Composite Property for <c>PatUbicacionGeografica</c> at IdUbicacionPadreSource
		///</summary>
		[ChildEntityType(typeof(PatUbicacionGeografica))]
		PatUbicacionGeografica,
	
		///<summary>
		/// Collection of <c>PatUbicacionGeografica</c> as OneToMany for PatRegimenTributarioCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatRegimenTributario>))]
		PatRegimenTributarioCollection,

		///<summary>
		/// Collection of <c>PatUbicacionGeografica</c> as OneToMany for PatEmpresaCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatEmpresa>))]
		PatEmpresaCollection,

		///<summary>
		/// Collection of <c>PatUbicacionGeografica</c> as OneToMany for PatUbicacionGeograficaCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatUbicacionGeografica>))]
		PatUbicacionGeograficaCollection,

		///<summary>
		/// Collection of <c>PatUbicacionGeografica</c> as OneToMany for PatClienteCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatCliente>))]
		PatClienteCollection,

		///<summary>
		/// Collection of <c>PatUbicacionGeografica</c> as OneToMany for PatUsuarioCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatUsuario>))]
		PatUsuarioCollection,

		///<summary>
		/// Collection of <c>PatUbicacionGeografica</c> as OneToMany for PatTallerCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatTaller>))]
		PatTallerCollection,
	}
	
	#endregion PatUbicacionGeograficaChildEntityTypes
	
	#region PatUbicacionGeograficaFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;PatUbicacionGeograficaColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatUbicacionGeografica"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatUbicacionGeograficaFilterBuilder : SqlFilterBuilder<PatUbicacionGeograficaColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatUbicacionGeograficaFilterBuilder class.
		/// </summary>
		public PatUbicacionGeograficaFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatUbicacionGeograficaFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatUbicacionGeograficaFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatUbicacionGeograficaFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatUbicacionGeograficaFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatUbicacionGeograficaFilterBuilder
	
	#region PatUbicacionGeograficaParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;PatUbicacionGeograficaColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatUbicacionGeografica"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatUbicacionGeograficaParameterBuilder : ParameterizedSqlFilterBuilder<PatUbicacionGeograficaColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatUbicacionGeograficaParameterBuilder class.
		/// </summary>
		public PatUbicacionGeograficaParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatUbicacionGeograficaParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatUbicacionGeograficaParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatUbicacionGeograficaParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatUbicacionGeograficaParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatUbicacionGeograficaParameterBuilder
	
	#region PatUbicacionGeograficaSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;PatUbicacionGeograficaColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatUbicacionGeografica"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class PatUbicacionGeograficaSortBuilder : SqlSortBuilder<PatUbicacionGeograficaColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatUbicacionGeograficaSqlSortBuilder class.
		/// </summary>
		public PatUbicacionGeograficaSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion PatUbicacionGeograficaSortBuilder
	
} // end namespace
